#include <future>
#include <iostream>

int add(int a, int b)
{
	return a + b;
}

void do_other_things() 
{
	std::cout << "Hello World" << std::endl;
}

int main()
{
	std::packaged_task<int(int, int)> task(add);
	do_other_things();
	std::future<int> result = task.get_future();
    std::thread th (std::move(task),1,1);   // spawn thread to count down from 10 to 0
	std::cout << result.get() << std::endl;
    th.join();
	return 0;
}
